package pl.andrzejag.seleniumtests;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;

public class HomePage extends Page {

	
	public HomePage(WebDriver driver) {
		super(driver);
	}
	
	public void checkIsLoggedIn(){
		WebElement messageContainer = driver.findElement(By.id("flash"));
		assertEquals("Logged in successfully", messageContainer.getText());
		assertTrue(messageContainer.isDisplayed());
	}
	
	public void checkSelectBox(String text){
		Select select;
		select = new Select(driver.findElement(By.id("project_id")));
		select.selectByVisibleText(text);
	}

}
